package com.sky.sentinel;

import com.alibaba.csp.sentinel.init.InitExecutor;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableApolloConfig
public class SentinelTrunkApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SentinelTrunkApplication.class, args);
        System.setProperty("project.name",
                context.getEnvironment().getProperty("spring.application.name","sentinel"));
        System.setProperty("csp.sentinel.dashboard.server",
                context.getEnvironment().getProperty("sentinel.dashboard.server","192.168.31.180:8080"));
        InitExecutor.doInit();
    }

}
